﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XrmLibrary.MsCrm4Adapter.Extensions
{
    public static class OptionSetValueExtensions
    {
        public static string GetLabelText(this Microsoft.Xrm.Sdk.OptionSetValue optionSetValue, string entityName, string attributeName)
        {
            string optionLabelText = string.Empty;

            if (String.IsNullOrWhiteSpace(entityName))
                throw new ArgumentNullException("Entity name cannot be null, empty, or consist of white-space characters.");

            if (String.IsNullOrWhiteSpace(attributeName))
                throw new ArgumentNullException("Attribute name cannot be null, empty, or consist of white-space characters.");

            Microsoft.Xrm.Sdk.Messages.RetrieveAttributeRequest request = new Microsoft.Xrm.Sdk.Messages.RetrieveAttributeRequest();
            request.EntityLogicalName = entityName;
            request.LogicalName = attributeName;
            request.RetrieveAsIfPublished = true;

            throw new NotImplementedException("Not finished yet.");


            //return optionLabelText;
        }
    }
}
